﻿cmake_minimum_required(VERSION 3.10)
project(UL_Logger)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

if(BUILD_EXAMPLE_EXE)
    unset(BUILD_EXAMPLE_EXE CACHE)
endif()
if(BUILD_SHARED_LIB)
    unset(BUILD_SHARED_LIB CACHE)
endif()

option(BUILD_EXAMPLE_EXE "Build example project" ON)
option(BUILD_SHARED_LIB "Build shared library instead of static" OFF)

if(${CMAKE_HOST_WIN32})
    message("UncleDon::Logger  Current environment: Win32")
    message("UncleDon::Logger  Current build type: ${CMAKE_BUILD_TYPE}")
    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY  ${PROJECT_SOURCE_DIR}/lib/Windows/${CMAKE_BUILD_TYPE})
elseif (${CMAKE_HOST_APPLE})
    message("UncleDon::Logger  Current environment: Apple MacOS")
    message("UncleDon::Logger  Current build type: ${CMAKE_BUILD_TYPE}")
    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY  ${PROJECT_SOURCE_DIR}/lib/MacOS/${CMAKE_BUILD_TYPE})
endif()

add_subdirectory(ULogger)

if(BUILD_EXAMPLE_EXE)
    add_subdirectory(Example)
endif()